<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
var countAndSay = function(n) {
    if( n == 1){
        return 1
    }
    var arr = ['1']
    var str = ''
    var count = 0
    var x = 0
    for( var i = 1 ; i<n ; i++ ){
        str = arr[i-1]
        count = 0
        for( var k = 0 ; k<str.length ; k++ ){
            x = str[k]
        }
    }
};

var n = 5
console.log(countAndSay(n))
    </script>
</body>
</html>